//
//  DDHZController.m
//  FruitsWholesaler
//
//  Created by sgone-2 on 15/11/29.
//  Copyright © 2015年 sgone. All rights reserved.
//

#import "DDHZController.h"
#import "DLTabedSlideView.h"
#import "One2ViewController.h"
#import "Two2ViewController.h"
#import "Three2ViewController.h"

@interface DDHZController ()<DLTabedSlideViewDelegate>



@property (weak, nonatomic) IBOutlet DLTabedSlideView *tabedSlideView;

@end

@implementation DDHZController







//隐藏tabbar
-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.hidesBottomBarWhenPushed = YES;
    }
    return self;
}




- (void)viewDidLoad {
    [super viewDidLoad];
     self.title = @"订单汇总";
    self.backBtn.hidden = NO;

    [self initItem2];


}

-(void)initItem2
{
    
    
    
    self.tabedSlideView.baseViewController = self;
    self.tabedSlideView.tabItemNormalColor = [UIColor grayColor];
    self.tabedSlideView.tabItemSelectedColor = BenSe_COLOR;
    self.tabedSlideView.tabbarTrackColor = BenSe_COLOR;
    self.tabedSlideView.tabbarBackgroundImage = [UIImage imageNamed:@"tabbarBk"];
    DLTabedbarItem *item1 = [DLTabedbarItem itemWithTitle:@"未完成" image:[UIImage imageNamed:@""] selectedImage:[UIImage imageNamed:@""] font:[UIFont systemFontOfSize:17]];
    DLTabedbarItem *item2 = [DLTabedbarItem itemWithTitle:@"已完成" image:[UIImage imageNamed:@""] selectedImage:[UIImage imageNamed:@""] font:[UIFont systemFontOfSize:17]];
    
    DLTabedbarItem *item3 = [DLTabedbarItem itemWithTitle:@"全 部" image:[UIImage imageNamed:@""] selectedImage:[UIImage imageNamed:@""] font:[UIFont systemFontOfSize:17]];
    
    self.tabedSlideView.tabbarItems = @[item1, item2, item3];
    [self.tabedSlideView buildTabbar];
    
    self.tabedSlideView.selectedIndex = 0;
    
    
}


- (NSInteger)numberOfTabsInDLTabedSlideView:(DLTabedSlideView *)sender{
    return 3;
}



- (UIViewController *)DLTabedSlideView:(DLTabedSlideView *)sender controllerAt:(NSInteger)index{
    switch (index) {
        case 0:
        {
            
            
            One2ViewController *ctrl = [[One2ViewController alloc]initWithNibName:nil bundle:nil];
            
            
            
            
            
            
            
            return ctrl;
        }
        case 1:
        {
            Two2ViewController *ctrl = [[Two2ViewController alloc] initWithNibName:nil bundle:nil];
            
            return ctrl;
        }
        case 2:
        {
            Three2ViewController *ctrl = [[Three2ViewController alloc] initWithNibName:nil bundle:nil];
            
            return ctrl;
        }
            
        default:
            return nil;
    }
}



@end
